Skip to main content

Filter

The 'filter' parameter modifies the response to only return elements that match filter criteria. Filter can only be used on properties that return literals, not arrays of objects.

Supported Operators: eq, ne, gt, ge, lt, le, or, and, not and parentheses ()

Supported Literals: 'string', number, true, false, null

Quotes: literal strings require single quotes. For example, filter=name eq 'Rocket'. Other literals should not be within single quotes. For example, filter=value gt 1

Case-Sensitivity: filter is NOT case-sensitive for property name, but IS case sensitive for literal.

Property Names: in the below examples, name, class, and value are all properties of the target elements. You can only filter by element properties. You can find available properties for any given class by referencing the openapi schema. For example, by looking at the response schema and selecting the class 'LiteralReal', we see that 'name' returns a string, 'class' returns a string, and 'value' returns a number.

Usage: curl -G "http://127.0.0.1:8090/mb/v1/elements" --data-urlencode "filter=<property name> <operator> <literal>"

Example: only return elements named 'rocket motor'
filter=name eq 'rocket motor'

Example: only return elements whose name is 'rocket mass', or elements that both have a class of 'LiteralReal' and a value greater than 0.5:
filter=name eq 'rocket mass' or (class eq 'LiteralReal' and value gt 0.5)